<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>视频 span10</title>
		<link rel="stylesheet" type="text/css" href="../css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/shopping_tag.css" />
		<link rel="stylesheet" type="text/css" href="css/video.css" />
		<link rel="stylesheet" type="text/css" href="css/base_transform.css"/>
		<style type="text/css">

		</style>
	</head>
	<body>
		<div class="main">
			<div class="video_box">
				<div class="bjb">
					<div class="bjb_box clearfix ">
						<div class="span_title">
							视频
						</div>
						<div class="boxd_hd_more">
							<a href="#" class="boxd_hd_more_a">
								查看更多
							</a>
						</div>
					</div>
					<div class="video_box_item">
						<ul class="video_box_ul clearfix">
							<li class="video_item_li">
								<a class="video_item_li_a" title="点击播放视频">
									<img class="video_item_img" src="http://cdn.cnbj1.fds.api.mi-img.com/mi-mall/e74c4ff741bcdfc5b28a48a43e4edc6d.jpg?thumb=1&w=296&h=180&f=webp&q=90">
									<span class="play">
										<i class="icon_play"></i>
									</span>
									<h3 class="video_box_title">2021年春季新品发布会第一场</h3>
									<p class="video_box_desc"></p>
								</a>
							</li>
							<li class="video_item_li">
								<a class="video_item_li_a" title="点击播放视频">
									<img class="video_item_img" src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/101b19aca4bb489bcef0f503e44ec866.jpg?thumb=1&w=296&h=180&f=webp&q=90">
									<span class="play">
										<i class="icon_play"></i>
									</span>
									<h3 class="video_box_title">Redmi 10X系列发布会</h3>
									<p class="video_box_desc">Redmi 10X系列发布会</p>
								</a>
							</li>
							<li class="video_item_li">
								<a class="video_item_li_a" title="点击播放视频">
									<img class="video_item_img" src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/96563e75833ba4563bd469dd28203b09.jpg?thumb=1&w=296&h=180&f=webp&q=90">
									<span class="play">
										<i class="icon_play"></i>
									</span>
									<h3 class="video_box_title">小米10 青春版 发布会</h3>
									<p class="video_box_desc"></p>
								</a>
							</li>
							<li class="video_item_li">
								<a class="video_item_li_a" title="点击播放视频">
									<img class="video_item_img" src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/2fd26bb99b723337a2f8eaba84f7d5bb.jpg?thumb=1&w=296&h=180&f=webp&q=90">
									<span class="play">
										<i class="icon_play"></i>
									</span>
									<h3 class="video_box_title">小米10 8K手机拍大片</h3>
									<p class="video_box_desc"></p>
								</a>
							</li>
						</ul>
					</div>
					<!-- 视频弹窗 -->
					<div class="video_play_box">
						<div class="video_play_box_a">
							<div class="video_play_box_title">
								
							</div>
							<div class="close_video">
								<span class="close_video_x">X</span>
							</div>
							<div class="video_content">
								<video  controls autoplay class="video_play_box_content_v" src=""></video>
							</div>
							
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>

<script type="text/javascript">
	(function(){
		var video_url=[
			"https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/812358b69886e576c66a01f1f00affe9.mp4",
			"https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/11c70c96529b6e6938567ec1aa0910e0.mp4",
			"https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/7cdabcaa763392c86b944eaf4e68d6a3.mp4",
			"https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/e25d81c4922fca5ebe51877717ef9b76.mp4"
		]
		var video_box_item=document.getElementsByClassName("video_box_item")[0];
		// 视频tag
		var video_item_li_a=video_box_item.getElementsByClassName("video_item_li_a");
		
		// console.log(video_item_li_a);
		// 视频窗口
		var video_play_box=document.getElementsByClassName("video_play_box")[0];
		// 视频播放的标题
		var video_play_box_title=video_play_box.getElementsByClassName("video_play_box_title")[0];
		// 视频窗口关闭
		var close_video=document.getElementsByClassName("close_video")[0];
		// 视频的内容
		var video_play_box_content_v=video_play_box.getElementsByClassName("video_play_box_content_v")[0];
		close_video.onclick=function(){
			video_play_box.style.opacity=0;//1
			video_play_box.style.zIndex=-111111;///6666666
			video_play_box_content_v.src="";
		}
		for(let i=0;i<video_item_li_a.length;i++){
			video_item_li_a[i].index=i;
			video_item_li_a[i].onclick=function(){
				// 视频标题
				var video_box_title=video_item_li_a[this.index].getElementsByClassName("video_box_title")[0];
				video_play_box.style.opacity=1;//1
				video_play_box.style.zIndex=6666666;///
				// 更改视频标题
				video_play_box_title.innerText=video_box_title.innerText;
				//更改视频url
				video_play_box_content_v.src=video_url[this.index];
			}
		}
		
	})()
</script>